package com.bigdata

/**
 * 求阶乘
 */
object Demo5Fun {

  def main(args: Array[String]): Unit = {

    // 5 * 4 * 3 * 2 * 1
    val result: Int = jc(5)
    println(result)

  }

  def jc(num: Int): Int = {
    if (num == 1) {
      1
    } else {
      num * jc(num - 1)
    }
  }


}
